iit

Basic SQL Queries


By Justin Callanan

Introduction
Database and query basics
Elements of a query
Writing an SQL query
Wrap-up
Quiz

Elements of an SQL query

A query must have several elements in order to extract data from the database. In SQL, these elements are called clauses, are are somewhat like the clauses of a sentence in English.

  • First, there is a statement that denotes a query is being made (as opposed to another database operation).
  • Following this, the fields from the table the query should return are stated.
  • Then, a clause states the name of the table from which the data will be returned.
  • All clauses after these are optional, but can restrict or organize the returned data further.

< Previous | Next >